package org.grow.numberone.service;

import com.alibaba.dubbo.config.annotation.Service;
import org.grow.zero.apis.NumberOneCommodityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;

import java.time.LocalDateTime;
import java.util.Map;

/**
 * @Author: xwg
 * @CreateDate: 21-8-18
 */

@Service
//@Spring Controller + RequestMapping
public class CommodityServiceImpl implements NumberOneCommodityService {

    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Override
    public String commodityTime() {
//
//        jdbcTemplate.query("")
        Map<String, Object> map =
                jdbcTemplate.queryForMap("select * from StudentScore where scoreId=1");
        System.out.println("number one 访问数据库"+map);
        return LocalDateTime.now()+" : from number one dubbo service";
    }
}
